LassoScript Utility
Basics Browse Detail

[OS_Process->SetEncoding]

Tag Link [OS_Process->SetEncoding] Category OS Process
Type Member Source Available Yes
Support Preferred Version 8.5
Change New Data Source Any
Output Type None Security None
Implementation Sets Lasso 8.5

Description

[OS_Process->SetEncoding] sets the character set which is used for the automatic conversion of data passed to the native process using [OS_Process->Write] and read from the process using [OS_Process->ReadString] or [OS_Process->ReadLine]. By default the encoding is set to UTF-8 if no character set has been set. If a byte stream is passed to [OS_Process->Write] then no encoding is applied and [OS_Process->Read] can be used to read the result of the native process as a raw byte stream.

Syntax

Var: 'myProcess' = (OS_Process: '/bin/cat');
$myProcess->(SetEncoding: 'iso-8859-1');
$myProcess->(Write: 'This is a test\n');
$myProcess->CloseWrite;
encode_html: $myProcess->ReadString;
$myProcess->Close;

Parameters

Required Parameters
Character Set The character set which should be used to automatically translate strings passed to [OS_Process->Write] and read from [OS_Process->ReadString].

Examples

See the Lasso 8 Language Guide for examples of how to use this tag.